import java.util.Scanner;

public class test4 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        
        System.out.print("Enter side 1: ");
        double side1 = scanner.nextDouble();
        System.out.print("Enter side 2: ");
        double side2 = scanner.nextDouble();
        System.out.print("Enter side 3: ");
        double side3 = scanner.nextDouble();
        boolean isLegal = (side1 + side2 > side3) && (side1 + side3 > side2) && (side2 + side3 > side1);
        
        if (isLegal) {
            double perimeter = side1 + side2 + side3;
            System.out.println("The perimeter of the triangle is " + perimeter);
        } else {
            System.out.println("Input is invalid.");
        }
        
        scanner.close();
    }
}
